﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Coaches.aspx.cs" Inherits="Autenticazione.Coaches" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href=Stile.css rel=Stylesheet type="text/css"></link>
</head>
<body>
    <form id="form1" runat="server">
    <div id="dvTop" style="height: 200px; border: 1px" align="center">
            <table width="100%">
                <tr style="height: 50px">
                    <td>&nbsp;</td>
                </tr>
                <tr style="height: 100px">
                    <td align="center">
                        <table>
                            <tr>
                                <td class="lblTitleHRef"><a href="Autenticazione.aspx">Login</a></td>
                                <td class="lblTitleHRef"><a href="Club.aspx">Club</a></td>
                                <td class="lblTitleNotHRef">Allenatori</td>
                                <td class="lblTitleHRef"><a href="Atleti.aspx">Atleti</a></td>
                                <td class="lblTitleHRef"><a href="Iscrizioni.aspx">Iscrizioni</a></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr style="height: 50px">
                    <td>&nbsp;</td>
                </tr>
            </table>
        </div>
        <table id="tblCoaches" border="0px" width="100%">
            <tr>
                <td colspan="2" align="right">
                    <asp:Label ID="msgLoggedUser" runat="server" CssClass="lblLoggedUser" Text=""></asp:Label>&nbsp;|&nbsp;<a href="Logout.aspx">Logout</a>
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Label ID="lblHelpNuovoCoach" runat="server" CssClass="lblInfo" Text="Per inserire nuovi allenatori cliccare sul link <B><I><U>Aggiungi allenatore</U></I></B>"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Label ID="msgHelpIscrizioni" runat="server" CssClass="lblInfo" Text="Per modificare i dati relativi agli allenatori cliccare sul pulsante matita (<img src=image/edit.gif border=0>), modificare i dati desiderati dopodichè cliccare sul pulsante memorizza (<img src=image/save.png border=0>). Per cancellare un allenatore premere il simbolo (<img src=image/delete.gif border=0>)"></asp:Label>
                &nbsp;quindi passare alla scheda <I><U>Atleti</U></I></td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                <table width="90%" border="0px">
                <tr>
                <td align="left">
                    <a href="#" onclick="Navigate()">Aggiungi allenatore</a>
                </td>
                </tr>
                <tr>
                <td align="left">
                    <asp:DataGrid runat="server" ID="dtgCoach" Width="100%" AutoGenerateColumns="false"
                    PageSize='<%# Autenticazione.Tools.Tools.GetMaxItemsForPage()%>' AllowPaging="true" AllowCustomPaging="true" DataKeyField="Line" AllowSorting="false"
                    OnEditCommand="dtgCoach_Edit" OnCancelCommand="dtgCoach_Cancel" OnDeleteCommand="dtgCoach_Delete"
                        OnUpdateCommand="dtgCoach_Update" 
                        onpageindexchanged="dtgCoach_SelectedIndexChanged" GridLines="Horizontal">
                    <AlternatingItemStyle BackColor="#CCCCCC" />
                    <Columns>
                        <asp:ButtonColumn Text="&lt;img src=image/Delete.gif border=0 title='Cancella allenatore'&gt;" CommandName="Delete">
												<HeaderStyle Width="5%"></HeaderStyle>
											</asp:ButtonColumn>
                        <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="&lt;img src=image/save.png border=0 title='Memorizza'&gt;" CancelText="&lt;img src=image/undo.png border=0 title='Abbandona'&gt;" EditText="&lt;img src=image/edit.gif border=0 title='Modifica dati'&gt;">
												<HeaderStyle Width="5%"></HeaderStyle>
											</asp:EditCommandColumn>
                        <asp:TemplateColumn HeaderText="Allenatore">
                            <ItemTemplate><label id="lblGDAllenatore" runat="server"><%# DataBinder.Eval(Container.DataItem, "FullName") %></label></ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox runat="server" MaxLength="100" ID="txtAllenatore" Wrap="false" AutoPostBack="false" Text=<%# DataBinder.Eval(Container.DataItem, "FullName") %>></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Telefono">
                            <ItemTemplate><label id="lblGDTelefono" runat="server"><%# DataBinder.Eval(Container.DataItem, "Phone") %></label></ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox runat="server" MaxLength="20" ID="txtPhone" Text=<%# DataBinder.Eval(Container.DataItem, "Phone") %>></asp:TextBox>
                                <asp:RegularExpressionValidator ID="RegTelefono" runat="server" 
                                    ErrorMessage="Numero di telefono non valido" Display="Dynamic" CssClass="err" ControlToValidate="txtPhone" ValidationExpression="([0-9]\-?)*">
                                    </asp:RegularExpressionValidator>
                            </EditItemTemplate>
                        </asp:TemplateColumn>
                    </Columns>
                        <EditItemStyle BackColor="Black" />
                        <FooterStyle BackColor="#666666" />
                    <HeaderStyle BackColor="#666666" Font-Bold="True" Font-Size="Small" />
                    <ItemStyle BackColor="White" ForeColor="Black" Font-Size="Small" />
                    <PagerStyle VerticalAlign="Middle" Visible="true" HorizontalAlign="Center" 
                            NextPageText="&gt;" PrevPageText="&lt;" Mode="NumericPages" PageButtonCount="5"
                            BackColor="#979797" ForeColor="Black" Wrap="False" Font-Size="Small">
                    </PagerStyle>
                    </asp:DataGrid>
                </td>
                </tr>
                </table>
                </td>
            </tr>
        </table>
    </form>
    <script type="text/javascript">
        function Navigate() {
            javascript: window.open('Coach.aspx', '', 'top=144,left=144,width=500,height=500,toolbar=0,menubar=0');
        }

        function Aggiorna() {
            javascipt: window.open('Coaches.aspx', '_self');
        }
    </script>
</body>
</html>
